//
//  顺序表的实现.c
//  博客代码
//
//  Created by 马鹏朔 on 2022/11/7.
//

#include "顺序表的实现.h"
void SLTEST1(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    SeqListPrint(&sl);

}
void SLTEST2(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    SeqListPopBack(&sl);
    SeqListPrint(&sl);

}
void SLTEST3(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    SeqListPushFront(&sl,1);
   SeqListPushFront(&sl,1);
    SeqListPushFront(&sl,1);
   SeqListPrint(&sl);
}
void SLTEST4(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    SeqListPopFront(&sl);
    SeqListPrint(&sl);

}
void SLTEST5(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    int x=0;
    printf("请输入你要查找的元素");
    scanf("%d",&x);
    int ret= SeqListFind(&sl, x);
    if(ret!=-1)
    {
        printf("查找成功坐标为：%d\n ",ret);
    }
    else
        printf("查找元素不存在");
    

}
void SLTEST6(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    int x=0;
    printf("请输入你要插入的元素的下标");
    scanf("%d",&x);
    SeqListInsert(&sl,x,5);
    SeqListPrint(&sl);
}
void SLTEST7(void)
{
    SL sl;
    SeqListPushBack(&sl,1);
    SeqListPushBack(&sl,2);
    SeqListPushBack(&sl,3);
    SeqListPushBack(&sl,4);
    int x=0;
    printf("请输入你要删除的元素的下标");
    scanf("%d",&x);
    SeqListErase(&sl,x);
    SeqListPrint(&sl);
}
int main()
{
    SLTEST7();
    return 0;
}
